/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package testinggggg;

import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;

/**
 *
 * @author lengogiang
 */
public class MyErrorHandler extends DefaultHandler{

    private void printE(SAXParseException e){
        System.out.println("Got Error "+ e.getMessage()+"\n at line: "+e.getLineNumber());
    }

    @Override
    public void error(SAXParseException e) throws SAXException {
        printE(e);
    }

    @Override
    public void fatalError(SAXParseException e) throws SAXException {
        printE(e);
    }

    @Override
    public void warning(SAXParseException e) throws SAXException {
        printE(e);
    }

    

}
